home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / emacsfilereq / filereq.doc < prev    next >
Text File  |  1999-09-13  |  5KB  |  155 lines

  1.  
  2.  
  3.  
  4.                 F I L E R E Q
  5.                 -------------
  6.  
  7.               Matti Rintala 1993
  8.  
  9.  
  10.            Use ReqTools filerequester with GnuEmacs
  11.  
  12.  
  13. First of all, if you use filereq, PLEASE SEND ME E-MAIL (or a
  14. postcard)! I like getting mail... :-)
  15.  
  16.  
  17.     What does filereq do?
  18.  
  19. I've always wanted GnuEmacs to ask for files with a decent graphical
  20. filerequester. I mean, there are menus but what good is selecting
  21. 'Open' from menu if you have to type in the filename using keyboard
  22. anyway!
  23.  
  24. Filereq is an Emacs elisp file (two if you count the byte-compiled
  25. version, four if you count the menu files) and an arexx script that
  26. enables you to use ReqTools filerequester in Emacs.
  27.  
  28. Note however, that filereq does not 'overwrite' functions using the
  29. existing file requesting method of Emacs (the minibuffer), but it
  30. defines its own functions that are then mapped to the same keys as the
  31. old ones, if so wanted.
  32.  
  33.  
  34.     Copyright
  35.  
  36. The elisp files and the arexx script which form filereq are public
  37. domain. This means you may use them freely and copy them to your
  38. friends as long as you don't make money with it. The only thing I ask
  39. is that my name stays with the files.
  40.  
  41. I usually prefer much longer copyright messages, but this utility is
  42. so small that what the heck.
  43.  
  44.  
  45.     System requirements
  46.  
  47. What you need is:
  48.  
  49. - An Amiga
  50. - OS 2.x (to run Emacs)
  51. - GnuEmacs ported to Amiga (filereq was made with GnuEmacs 18.58,
  52.   Amiga port 1.26DG, ported by Dvaid Gay)
  53. - ARexx (comes with 2.x)
  54. - ReqTools.library by Nico François (can be found in many ftp places
  55.   and in fish disks)
  56. - RexxReqTools.library by Rafael D'Halleweyn (comes nowadays with
  57.   ReqTools, at least did with version 2.1d)
  58.  
  59.  
  60.     Installation
  61.  
  62. 1) Copy FileReq.elx to Rexx: directory
  63.  
  64. 2) Copy filereq.el and filereq.elc to GnuEmacs:lisp directory
  65.  
  66. 3) If you want to use my menu definitions, copy filereq-menu.menu and
  67.    filereq-menu.el to GnuEmacs:lisp, too
  68.  
  69.  
  70.     How to test
  71.  
  72. Simple. Say 'M-x load-file GnuEmacs:lisp/filereq.elc' (with RETURN
  73. between the load-file and the filename, of course). Now the new
  74. functions have been defined. To change default key mappings (provided
  75. you haven't mapped the file commands to other keys) say 'M-x
  76. filereq-set-keys'. Now the keys 'C-x C-f', 'C-x C-w', 'C-x C-r', 'C-x
  77. C-v', 'C-x i', 'C-x 4 C-f' and 'C-x 4 f' should do their functions
  78. with filerequester. If the notation used in the keys is not familiar
  79. to you or you don't know what the key sequences are supposed to do,
  80. contact your Emacs info or manual.
  81.  
  82. To try the menus say 'M-x load-file GnuEmacs:lisp/filereq-menu.el'.
  83. Now the menus should use filerequesters. Note that 'filereq.elc' must
  84. already have been loaded before using the menus.
  85.  
  86.     How to set filereq up permanently
  87.  
  88. Edit your s:.emacs file. Add (to the end, for example) the line
  89.  
  90. (load "filereq" nil t nil)
  91.  
  92. If you want the keys ('C-x C-f' etc.) to use filerequesters, add after
  93. that the line
  94.  
  95. (filereq-set-keys)
  96.  
  97. If you want the menus, copy filereq-menu.el to s:.emacs-menu.el and
  98. filereq-menu.menu to s:.emacs-menu.menu.
  99.  
  100. Thats it.
  101.  
  102.  
  103.     How is filereq done?
  104.  
  105. Filereq's basis is the function 'filereq-read-file-name' which starts
  106. the arexx script FileReq.elx which in turn uses RexxReqTools.library
  107. which in turn uses ReqTools.library to bring up the file requester.
  108. FileReq.elx then commands Emacs (via arexx again) to store the file
  109. name entered to variable filereq-filename.
  110.  
  111. filereq-read-file-name takes four arguments:
  112.  
  113.     prompt:        The prompt displayed in the title bar of the
  114.             requester
  115.     directory:    Initial directory
  116.     filename:    Initial filename
  117.     exist:        nil if file does not have to exist, t if it
  118.             does.
  119.  
  120. Using this function six other functions are defined, which simply call the
  121. function above to get the filename and then call the function they are
  122. meant to replace. These functions are:
  123.  
  124. filereq-find-file:    Replacement for find-file
  125. filereq-write-file:    Replacement for write-file
  126. filereq-find-file-read-only: Replacement for find-file-read-only
  127. filereq-fine-alternate-file: Replacement for find-alternate-file
  128. filereq-insert-file:    Replacement for insert-file
  129. filereq-find-file-other-window: Replacement for find-file-other-window
  130.  
  131. It is of course very easy to write replacements for the rest of the
  132. file functions, but these functions are normally mapped to the
  133. keyboard, so I've only included them.
  134.  
  135. The function filereq-set-keys simply uses global-set-key to redifine
  136. some key sequences.
  137.  
  138. The menus are quite straightforward as they simply have the
  139. filereq-functions in their entrys.
  140.  
  141.  
  142.  
  143.     I hope you have use for filereq!
  144.  
  145.     DON'T FORGET THE E-MAIL (OR A POSTCARD)!!
  146.  
  147.     Here's the address:
  148.  
  149.     email: bitti@cs.tut.fi
  150.  
  151.     Matti Rintala
  152.     Pyykkiojankatu 2 C 24
  153.     33710  TAMPERE
  154.     FINLAND
  155.